package com.eedi.framework.org.dal.mapper;

import com.eedi.framework.common.enums.CommonStatusEnum;
import com.eedi.framework.mybatis.core.mapper.BaseMapperX;
import com.eedi.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.eedi.framework.org.dal.dataobject.SysOrgConfigLinksDO;
import org.apache.ibatis.annotations.Mapper;

@Mapper
public interface SysOrgConfigLinksMapper extends BaseMapperX<SysOrgConfigLinksDO> {

    default SysOrgConfigLinksDO selectByLinksId(String orgConfigId, String orgConfigLinksId){
        LambdaQueryWrapperX<SysOrgConfigLinksDO> queryWrapper = new LambdaQueryWrapperX<>();
        queryWrapper.eq(SysOrgConfigLinksDO::getOrgConfigId, orgConfigId)
                .eq(SysOrgConfigLinksDO::getOrgConfigLinksId, orgConfigLinksId)
                .eq(SysOrgConfigLinksDO::getLinksStatus, CommonStatusEnum.ENABLE)
                .orderByAsc(SysOrgConfigLinksDO::getLinksSort);
        return this.selectOne(queryWrapper);
    }
}
